$(function() {
    var url = 'http://localhost:3000/v1/sc/sc_hot_city'
$.get(url,data=>{
    console.log(data)
    $('.header .banner ul ').html(
        data.data.map(value=>{
            const {country,city} = value
            return `
            <li>
            <p>${country}</p>
            <span>${city}</span>
            </li>
            `
        })
    )
})
var url = 'http://localhost:3000/v1/sc/fresh'
$.get(url,data=>{
    console.log(data)
    $('.main .fresh div ul').html(
        data.data.map(value=>{
            const {pic,title,price} = value
            return `
            <li>
                    <img src="${pic}" alt="">
                    <div>
                        <p class="line-2">${title}</p>
                        <span><p>${price}</p>元起</span>
                    </div>
                </li>
            `
        })
    )
})
var url = 'http://localhost:3000/v1/sc/free_travel'
$.get(url,{deptid:1},data=>{
    console.log(data)
    $('.main .free-travel .bottom ul ').html(
        data.data.map(value=>{
            const {pic,types,price, detail,dt_time} = value
            return `
            <li >
            <div class="img"><img src="${pic}" alt="">
            <div class="pl">
                <div class="types">${types}</div><div class="price">${price}</div>
            </div>

            </div>
            <div class="detail">
                <span class="line-2">${detail}</span>
                <p>${dt_time}</p>
            </div>
        </li>
            `
        })
    )
})
$('.main .free-travel .top ul li').mouseover(function() {
    $(this).addClass('active').siblings().removeClass('active')
})
var url = 'http://localhost:3000/v1/sc/worth_travel'
$.get(url,data=>{
    console.log(data)
    $('.worth-travel .bottom ul').html(
        data.data.map(value=>{
            const {pic,detail,price} = value
            return `
            <li>
            <div class="mask"></div>
            <div class="mask2"></div>
            <div class="tags">定制游</div>
            <img src="${pic}" alt="">
            <div class="text">
                <p class="line-2">${detail}</p>
                <span><p>${price}</p>元起</span>
            </div>
            </li>
            `
        })
    )
})

$('.local-fun ul li').mouseover(function(){
    $(this).addClass('active').siblings().removeClass('active')
})



})